//SV: Nguyen Van Hoa
// program : Giai phuong trinh bac hai :ax2+bx+c=0


#include"stdio.h"
#include"conio.h"
#include"math.h"
main()
{
	
	float a, b, c, delta, x1, x2;
	printf("\n Hay nhap vao gia tri cua a=");
	scanf("%f", &a);
	printf("\n Hay nhap vao gia tri cua b=");
	scanf("%f", &b);
	printf("\n Hay nhap vao gia tri cua c=");
	scanf("%f", &c);
	if(a==0)
		{printf("\n Day khong phai phuong trinh bac 2");
	}
	else
		delta=pow(b,2)-4*a*c;
		if(delta<0)
			printf("\n Phuong trinh vo nghiem ");
		else 
			if(delta==0)
				printf("\n phuong trinh co nghiem kep x1=x2= %f","x1=x2=-b/2*a");
			else
				printf("\n Phuong trinh co hai nghiem phan biet la x1=%f \nx2=%f", "x1=(-b-sqrt(delta))/2*a, x2=(-b+sqrt(delta)/2*a)");
				
		//getch();
		
}
